home *** CD-ROM | disk | FTP | other *** search
/ Risc World 5 / Risc World 5.iso / SOFTWARE / Issue3 / Games / xrick / !xrick / include / h / maps < prev    next >
Text File  |  2004-06-24  |  3KB  |  151 lines

  1. /*
  2.  * xrick/include/maps.h
  3.  *
  4.  * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net). All rights reserved.
  5.  *
  6.  * The use and distribution terms for this software are contained in the file
  7.  * named README, which can be found in the root of this distribution. By
  8.  * using this software in any fashion, you are agreeing to be bound by the
  9.  * terms of this license.
  10.  *
  11.  * You must not remove this notice, or any other, from this software.
  12.  */
  13.  
  14. #ifndef _MAPS_H
  15. #define _MAPS_H
  16.  
  17. #include "system.h"
  18.  
  19. #define MAP_NBR_MAPS 0x05
  20. #define MAP_NBR_SUBMAPS 0x2F
  21. #define MAP_NBR_CONNECT 0x99
  22. #define MAP_NBR_BNUMS 0x1FD8
  23. #define MAP_NBR_BLOCKS 0x0100
  24. #define MAP_NBR_MARKS 0x020B
  25. #define MAP_NBR_EFLGC 0x0020
  26.  
  27. /*
  28.  * map row definitions, for three zones : hidden top, screen, hidden bottom
  29.  * the three zones compose map_map, which contains the definition of the
  30.  * current portion of the submap.
  31.  */
  32. #define MAP_ROW_HTTOP 0x00
  33. #define MAP_ROW_HTBOT 0x07
  34. #define MAP_ROW_SCRTOP 0x08
  35. #define MAP_ROW_SCRBOT 0x1F
  36. #define MAP_ROW_HBTOP 0x20
  37. #define MAP_ROW_HBBOT 0x27
  38.  
  39. extern U8 map_map[0x2c][0x20];
  40.  
  41. /*
  42.  * main maps
  43.  */
  44. typedef struct {
  45.   U16 x, y;        /* initial position for rick */
  46.   U16 row;        /* initial map_map top row within the submap */
  47.   U16 submap;    /* initial submap */
  48.   char *tune;    /* map tune */
  49. } map_t;
  50.  
  51. extern map_t map_maps[MAP_NBR_MAPS];
  52.  
  53. /*
  54.  * sub maps
  55.  */
  56. typedef struct {
  57.   U16 page;            /* tiles page */
  58.   U16 bnum;            /* first block number */
  59.   U16 connect;         /* first connection */
  60.   U16 mark;            /* first entity mark */
  61. } submap_t;
  62.  
  63. extern submap_t map_submaps[MAP_NBR_SUBMAPS];
  64.  
  65. /*
  66.  * connections
  67.  */
  68. typedef struct {
  69.   U8 dir;
  70.   U8 rowout;
  71.   U8 submap;
  72.   U8 rowin;
  73. } connect_t;
  74.  
  75. extern connect_t map_connect[MAP_NBR_CONNECT];
  76.  
  77. /*
  78.  * blocks - one block is 4 by 4 tiles.
  79.  */
  80. typedef U8 block_t[0x10];
  81.  
  82. extern block_t map_blocks[MAP_NBR_BLOCKS];
  83.  
  84. /*
  85.  * flags for map_marks[].ent ("yes" when set)
  86.  *
  87.  * MAP_MARK_NACT: this mark is not active anymore.
  88.  */
  89. #define MAP_MARK_NACT (0x80)
  90.  
  91. /*
  92.  * mark structure
  93.  */
  94. typedef struct {
  95.   U8 row;
  96.   U8 ent;
  97.   U8 flags;
  98.   U8 xy;  /* bits XXXX XYYY (from b03) with X->x, Y->y */
  99.   U8 lt;  /* bits XXXX XNNN (from b04) with X->trig_x, NNN->lat & trig_y */
  100. } mark_t;
  101.  
  102. extern mark_t map_marks[MAP_NBR_MARKS];
  103.  
  104. /*
  105.  * block numbers, i.e. array of rows of 8 blocks
  106.  */
  107. extern U8 map_bnums[MAP_NBR_BNUMS];
  108.  
  109. /*
  110.  * flags for map_eflg[map_map[row][col]]  ("yes" when set)
  111.  *
  112.  * MAP_EFLG_VERT: vertical move only (usually on top of _CLIMB).
  113.  * MAP_EFLG_SOLID: solid block, can't go through.
  114.  * MAP_EFLG_SPAD: super pad. can't go through, but sends entities to the sky.
  115.  * MAP_EFLG_WAYUP: solid block, can't go through except when going up.
  116.  * MAP_EFLG_FGND: foreground (hides entities).
  117.  * MAP_EFLG_LETHAL: lethal (kill entities).
  118.  * MAP_EFLG_CLIMB: entities can climb here.
  119.  * MAP_EFLG_01:
  120.  */
  121. #define MAP_EFLG_VERT (0x80)
  122. #define MAP_EFLG_SOLID (0x40)
  123. #define MAP_EFLG_SPAD (0x20)
  124. #define MAP_EFLG_WAYUP (0x10)
  125. #define MAP_EFLG_FGND (0x08)
  126. #define MAP_EFLG_LETHAL (0x04)
  127. #define MAP_EFLG_CLIMB (0x02)
  128. #define MAP_EFLG_01 (0x01)
  129.  
  130. extern U8 map_eflg_c[MAP_NBR_EFLGC];  /* compressed */
  131. extern U8 map_eflg[0x100];  /* current */
  132.  
  133. /*
  134.  * map_map top row within the submap
  135.  */
  136. extern U8 map_frow;
  137.  
  138. /*
  139.  * tiles offset
  140.  */
  141. extern U8 map_tilesBank;
  142.  
  143. extern void map_expand(void);
  144. extern void map_init(void);
  145. extern U8 map_chain(void);
  146. extern void map_resetMarks(void);
  147.  
  148. #endif
  149.  
  150. /* eof */
  151.